package tech.mhuang.ext.jwt.springboot.sample;

import org.springframework.boot.SpringApplication;
import org.springframework.boot.autoconfigure.SpringBootApplication;
import org.springframework.context.annotation.Bean;
import tech.mhuang.ext.jwt.admin.JwtHelper;
import tech.mhuang.ext.jwt.admin.bean.Jwt;
import tech.mhuang.ext.jwt.admin.external.IJwtExternal;
import tech.mhuang.ext.jwt.admin.external.IJwtProducer;

import java.util.Map;

/**
 *
 * jwt测试
 *
 * @author mhuang
 * @since 1.0.0
 */
@SpringBootApplication
public class JwtSampleApplication {

    //开启采用自定义Jwt解析方式、注释掉采用默认JWT方式
    static class CustomJwtExternal implements  IJwtExternal{
        @Override
        public IJwtProducer create(String key) {
            System.out.println("自定义Jwt生产");
            return new JwtHelper();
        }
    }
    @Bean
    public IJwtExternal customJwtExternal(){
        return new CustomJwtExternal();
    }

    public static void main(String[] args) {
        SpringApplication.run(JwtSampleApplication.class,args);
    }
}
